<?php

namespace app\model\scope;

trait ScopeName
{
    public function scopeName($query, $name='')
    {
        return $query->whereLike('name', '%' . $name . '%');
    }
}